package test;

import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.locks.ReentrantLock;

public class Main {
    /*    public static void main(String[] args) {
            HashMap<Integer, Integer> hashMap = new HashMap<>();
            hashMap.put(10, 10);
            System.out.println(hashMap);
            hashMap.remove(10);
            System.out.println(hashMap);
            
            
            ArrayList<Integer> list = new ArrayList<>();
            list.add(1000);
            list.add(100);
            System.out.println(list);
            
            
            Hashtable<Integer, Integer> hashtable = new Hashtable<>();
            hashtable.put(10, 10);
            hashtable.put(10, 10);
            hashtable.contains(10);
            hashtable.containsKey(10);
            hashtable.containsValue(10);
        
            ConcurrentHashMap<Integer, Integer> concurrentHashMap = new ConcurrentHashMap<>();
            concurrentHashMap.put(10, 100);
            concurrentHashMap.get(10);
        }*/
    public static void main(String[] args) throws Exception {
        Thread main = Thread.currentThread();
        
        Thread t1 = new Thread(() -> {
            System.out.println("start.........................");
            try {
                Thread.sleep(1000 * 5);
                System.out.println("main方法线程状态：" + main.getState());
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("end.........................");
        });
        t1.setDaemon(true);
        t1.start();
        System.out.println("22222222222222222222222222222222");
        System.out.println("22222222222222222222222222222222");
        Thread t2 = new Thread(() -> {
            System.out.println("T2 start......................");
            try {
                Thread.sleep(1000 * 3);
                System.out.println("T2  main方法线程状态：" + main.getState());
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("T2   end......................");
        });
        t2.start();
    }
}